<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.11/vue.min.js"></script>
</head>
<body>
    
    <div id="app">
        <h1>app</h1>
        <test>
            <h6>aaa</h6>
        </test>
    </div>

    <template id="testTemp">
        <div>
            <slot></slot>
            <h3>这个是test组件</h3>
            <slot></slot>
        </div>
    </template>

    <script>
        Vue.component('test', {
            template:'#testTemp'
        })

        var app = new Vue({
            el:'#app',
        })
    </script>
    
</body>
</html>